from .base import *

INSTALLED_APPS += [
    'debug_toolbar',  # django-debug-toolbar
]

# django-debug-toolbar
INTERNAL_IPS = [
    '127.0.0.1',
]

MIDDLEWARE += [
    'debug_toolbar.middleware.DebugToolbarMiddleware',  # django-debug-toolbar
]

# 开发时也使用MySQL，贴近实际，而且代码中使用了MySQL中的date_format函数，否则报错
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME':
        'django_blog',  # create database django_blog default charset utf8;
        'HOST': '127.0.0.1',
        'USER': 'root',
        'PASSWORD': 'root',
    }
}
# DATABASES = {
#     'default': {  # sudo -i -u postgres  # psql
#         'ENGINE': 'django.db.backends.postgresql',  # pipenv install psycopg2
#         'NAME': 'test2',  # createdb --owner rui test2
#         'HOST': '127.0.0.1',
#         'USER': 'rui',   #  createuser --interactive -P
#         'PASSWORD': 'rui',
#     }
# }

# 开发环境下邮箱设置 - 本地文件格式
# EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
# EMAIL_FILE_PATH = os.path.join(BASE_DIR, 'email')  # change this to a proper location
EMAIL_HOST_USER = 'a@b.com'
SITE_HOST = '127.0.0.1:8000'

# 控制台输出模式  https://docs.djangoproject.com/en/3.0/topics/email/#console-backend
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

# 注：
# 部署时STATIC_ROOT和MEDIA_ROOT生产环境中交由Nginx服务
